<include file="application/walletyhbbadmin/view/public/left.html"/>
<div id="dcMain">
    <!-- 当前位置 -->
    <div id="urHere">管理中心<b>></b><strong>首页信息</strong> </div>
    <div class="mainBox" style="height:auto!important;height:550px;min-height:550px;">


        <div id="list">
           <h3>修改产品</h3><br/>
            <div class="content" style="padding-left: 100px;">
                <form action="{:U('doedit')}" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="id" value="{$res.ct_id}">
                    名&nbsp;&nbsp;称(中): &nbsp;<input type="text" name="name" value="{$res.ct_name}" style="border: 1px solid #CCCCCC; height: 30px;width: 300px;"><br/><br/>
                    名&nbsp;&nbsp;称(英): &nbsp;<input type="text" name="uname" value="{$arr.ct_name}" style="border: 1px solid #CCCCCC; height: 30px;width: 300px;"><br/><br/>
                    名&nbsp;&nbsp;称(日): &nbsp;<input type="text" name="jname" value="{$ar.ct_name}" style="border: 1px solid #CCCCCC; height: 30px;width: 300px;"><br/><br/>
                    图&nbsp;&nbsp;片:&nbsp; <img src="{$res.ct_pic}" alt="" style="width: 150px;"> <input type="file" name="pic" value=""><br/><br/>

                    分&nbsp;&nbsp;类:&nbsp;
                    <select name="xuan" id="tid">
                        <option value="{$res.fuleiid}">{$res.fuleiming}</option>
                            <foreach name="list" item="vc">
                            <option value="{$vc.id}">{$vc.name}</option>
                        </foreach>
                    </select>
                    <select id="tid1"  name="fenlei">
                        <option value="{$res.ct_gid}">{$res.fenleiming}</option>
                        <option value="" class="ss">--请选择--</option>
                    </select>
<!--                    商品简介: <textarea name="jianjie" id="jianjie" cols="100" rows="10" style="border: 1px solid #CCCCCC;">{$res.ct_jianjie}</textarea><br/><br/>-->
                    <tr>
                        <td align="right" valign="top">商品简介(中)：</td>
                        <td>
                            <!-- KindEditor -->
                            <link rel="stylesheet" href="__PUBLIC__/app/admin/js/kindeditor/themes/default/default.css" />
                            <link rel="stylesheet" href="__PUBLIC__/app/admin/js/kindeditor/plugins/code/prettify.css" />
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/kindeditor.js"></script>
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/lang/zh_CN.js"></script>
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/plugins/code/prettify.js"></script>
                            <script>
                                KindEditor.ready(function(K) {
                                    var editor1 = K.create('textarea[name="content"]', {
                                        cssPath : '../plugins/code/prettify.css',
                                        uploadJson : '../php/upload_json.php',
                                        fileManagerJson : '../php/file_manager_json.php',
                                        allowFileManager : true,
                                        afterCreate : function() {
                                            var self = this;
                                            K.ctrl(document, 13, function() {
                                                self.sync();
                                                K('form[name=example]')[0].submit();
                                            });
                                            K.ctrl(self.edit.doc, 13, function() {
                                                self.sync();
                                                K('form[name=example]')[0].submit();
                                            });
                                        }
                                    });
                                    prettyPrint();
                                });
                            </script>
                            <!-- /KindEditor -->
                            <textarea id="content" name="content" style="width:780px;height:400px;" class="textArea">{$res.ct_jianjie}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top">商品简介(英)：</td>
                        <td>
                            <!-- KindEditor -->
                            <link rel="stylesheet" href="__PUBLIC__/app/admin/js/kindeditor/themes/default/default.css" />
                            <link rel="stylesheet" href="__PUBLIC__/app/admin/js/kindeditor/plugins/code/prettify.css" />
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/kindeditor.js"></script>
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/lang/zh_CN.js"></script>
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/plugins/code/prettify.js"></script>
                            <script>
                                KindEditor.ready(function(K) {
                                    var editor1 = K.create('textarea[name="ucontent"]', {
                                        cssPath : '../plugins/code/prettify.css',
                                        uploadJson : '../php/upload_json.php',
                                        fileManagerJson : '../php/file_manager_json.php',
                                        allowFileManager : true,
                                        afterCreate : function() {
                                            var self = this;
                                            K.ctrl(document, 13, function() {
                                                self.sync();
                                                K('form[name=example]')[0].submit();
                                            });
                                            K.ctrl(self.edit.doc, 13, function() {
                                                self.sync();
                                                K('form[name=example]')[0].submit();
                                            });
                                        }
                                    });
                                    prettyPrint();
                                });
                            </script>
                            <!-- /KindEditor -->
                            <textarea id="ucontent" name="ucontent" style="width:780px;height:400px;" class="textArea">{$arr.ct_jianjie}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top">商品简介(日)：</td>
                        <td>
                            <!-- KindEditor -->
                            <link rel="stylesheet" href="__PUBLIC__/app/admin/js/kindeditor/themes/default/default.css" />
                            <link rel="stylesheet" href="__PUBLIC__/app/admin/js/kindeditor/plugins/code/prettify.css" />
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/kindeditor.js"></script>
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/lang/zh_CN.js"></script>
                            <script charset="utf-8" src="__PUBLIC__/app/admin/js/kindeditor/plugins/code/prettify.js"></script>
                            <script>
                                KindEditor.ready(function(K) {
                                    var editor1 = K.create('textarea[name="jcontent"]', {
                                        cssPath : '../plugins/code/prettify.css',
                                        uploadJson : '../php/upload_json.php',
                                        fileManagerJson : '../php/file_manager_json.php',
                                        allowFileManager : true,
                                        afterCreate : function() {
                                            var self = this;
                                            K.ctrl(document, 13, function() {
                                                self.sync();
                                                K('form[name=example]')[0].submit();
                                            });
                                            K.ctrl(self.edit.doc, 13, function() {
                                                self.sync();
                                                K('form[name=example]')[0].submit();
                                            });
                                        }
                                    });
                                    prettyPrint();
                                });
                            </script>
                            <!-- /KindEditor -->
                            <textarea id="jcontent" name="jcontent" style="width:780px;height:400px;" class="textArea">{$ar.ct_jianjie}</textarea>
                        </td>
                    </tr>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input name="submit" class="btn" type="submit" value="提交" />
<!--                            <button class="layui-btn layui-btn-small layui-btn-normal" lay-submit  lay-filter="sub">确认保存</button>-->
<!--                            <button class="layui-btn layui-btn-small layui-btn-primary" id="back">返回操作</button>-->
                        </div>
                    </div>
                </form>
            </div>
        </div>

    </div>
</div>
<div class="clear"></div>
<include file="application/walletyhbbadmin/view/public/foot.html"/><!-- dcFooter 结束 -->
<div class="clear"></div> </div>
<script type="text/javascript">

    onload = function()
    {
        document.forms['action'].reset();
    }

    function douAction()
    {
        var frm = document.forms['action'];
        frm.elements['new_cat_id'].style.display = frm.elements['action'].value == 'category_move' ? '' : 'none';
    }




    //实名认证
    function authentication(id){
        layer.open({
            type: 2,
            title: '实名认证',
            maxmin: true,
            shadeClose: true,
            area : ['800px' , '850px'],
            content: '{:U("Member/authentication")}?member_id='+id
        });
    }





    //添加地址
    function addaddress(id){
        layer.open({
            type: 2,
            title: '添加地址',
            maxmin: true,
            shadeClose: true,
            area : ['800px' , '850px'],
            content: '{:U("Member/addaddress")}?member_id='+id
        });
    }




    function shanchu(id) {
        var url = "{:U('Member/delete')}";
        var msg = "您确定要删除吗？";
        if (confirm(msg)==true){
            $.post(url, {'member_id': id}, function (data) {
                layer.msg(data.info);
                if (data.status == 1) {
                    setTimeout(function () {
                        window.location.reload();
                    }, 2000);
                }
            });
        }
    }

    //注册审核通过
    function audit_y(id) {
        var url = "{:U('Member/audit_y')}";
        $.post(url, {id: id}, function (data) {
            layer.msg(data.info);
            if (data.status == 1) {
                setTimeout(function () {
                    window.location.reload();
                }, 2000);
            }
        })
    }
    function shanchu(id){
        var url="{:U('Member/delete')}";
        var msg = "您确定要删除吗？";
        if (confirm(msg)==true) {
            $.post(url, {'member_id': id}, function (data) {
                layer.msg(data.info);
                if (data.status == 1) {
                    setTimeout(function () {
                        window.location.reload();
                    }, 2000);
                }
            });
        }
    }

    //查看代理申请信息
    function getDistributInfo(user_id){
        layer.open({
            type: 2,
            title: '代理申请信息',
            maxmin: true,
            shadeClose: true,
            area : ['800px' , '850px'],
            content: '{:U("Member/getDistributInfo")}?user_id='+user_id
        });
    }


</script>
</body>
</html>
<script>
    $(document).ready(function(){
        $("#tid").change(function(){
            var fid = $(this).val();
            // console.log(fid);
            $.ajax({
                'url':'{:U("Finance/xuanzeType")}',//请求的url
                'type':'get',//请求类型
                'data':{parentId:fid},//附加参数
                'async':true,//异步处理
                'dataType':'json',//响应数据返回类型
                success:
                //data 响应数据
                    function(data){
                        $("#tid1 option").remove();//清除
                        console.log(data);//f12打印
                        var option = '<option value="">--请选择--</option>';
                        // //遍历
                        for(var i=0;i<data.length;i++){
                            //禁用
                            // $(".ss").attr("disabled",true);
                            //alert(data[i].name);
                            //把获取的数据存储在option标签里
                            option +='<option value="'+data[i].id+'">'+data[i].name+'</option>';
                            // alert(option);
                        }
                        //内部插入到第一个select
                        $("#tid1").append(option);
                        $("#tid1").css('display',"inline-block");
                    },
                error:
                    function () {
                        alert("Ajax响应失败");
                    }
            });
        });

    });
</script>